public class Test {
    public static void main(String[] args) {
        MyStack s = new MyStack();
        s.push(1);
        s.push(2);
        s.push(3);
        s.push(4);
        System.out.println(s.size()); // 获取栈中有效元素个数---> 4
        System.out.println(s.peek()); // 获取栈顶元素---> 4
        s.pop(); // 4出栈，栈中剩余1 2 3，栈顶元素为3
        System.out.println(s.pop()); // 3出栈，栈中剩余1 2
        if (s.empty()) {
            System.out.println("栈空");
        } else {
            System.out.println(s.size());
        }

        MySqQueue sqQueue = new MySqQueue();
        sqQueue.offer(1);
        sqQueue.offer(2);
        sqQueue.offer(3);
        sqQueue.offer(4);
        System.out.println(sqQueue.full());

        System.out.println("=============================");
        QueueBy2Stack q = new QueueBy2Stack();
        q.offer(1);
        q.offer(2);
        q.offer(3);
        System.out.println(q.poll());
        q.offer(4);
    }
}
